# -*- encoding:utf-8 -*-
# !/usr/bin/env python
'''
    python-0820-02.py
    ======================
    @descript: 单线程
    @copyright:nnz
    @author:dln
    @date: 2021/8/22 13:22
    @version:v1.0
'''
import threading,time

def fun_a(pnum):
    print('线程{}开始'.format(threading.currentThread().getName()))
    for element in range(1,pnum):
        print(' 线程{},输出的值为{}'.format(threading.currentThread().getName(),element))
        time.sleep(2)
        pass
    pass
if __name__ == '__main__':
    print('线程{}开始'.format(threading.currentThread().getName()))
    v_object=threading.Thread(target=fun_a,args=(11,),name='xiancheng')   #给线程定义名字
    v_object.start()
    for element in range(1,11):
        print(' 线程{},输出的值为{}'.format(threading.currentThread().getName(),element))
        pass
    print('线程{}结束'.format(threading.currentThread().getName()))
    pass
